#!/bin/bash
# 第一行必须这么声明, 也可以使用“!/bin/sh”, 

BASEDIR=$(dirname $0)
#echo  "当前目录:${BASEDIR}"
printf   "当前目录:\e[1;34m  ${BASEDIR}   \e[0m \n"
printf   "当前文件:\e[1;34m  $0  \e[0m \n"



docker_dir="${BASEDIR}/docker"

architecture=$(uname -m)
echo "CPU架构为 $architecture "

# 可得到 prints values such as x86_64, i686, arm, or aarch64
# x86_64 



if [ "$architecture" = "x86_64"   ]    ;then
   echo "当前为Intel 的x86_64 架构 "
   cd  "${docker_dir}/docker-env-pro-intel64" ;

   docker-compose run app bash  ;

   exit 0 ;
elif [ "$architecture" = "arm"   ]    || [ "$architecture" = "arm64" ]   ;then
   echo "当前为apple arm 的 64 架构 "

   cd  "${docker_dir}/docker-env-pro-arm64" ;

   docker-compose run app bash  ;

   exit 0 ;

elif [ "$1" = "h"   ]  || [ "$1" = "help" ] || [ "$1" = "-h" ]|| [ "$1" = "-help" ] ;then
   exit 0 ; 
   
fi 






